<?php /* Smarty version 2.6.19, created on 2010-10-26 17:01:12
         compiled from reg.html */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万利达书城通行证</title>
<link href="skins/stlye/footer.css" rel="stylesheet" type="text/css" />
<link href="skins/stlye/link.css" rel="stylesheet" type="text/css" />
<link href="skins/stlye/globle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.1.js"></script>
<script language="javascript"  type="text/javascript">
function isCnAndEnAndNumber(str){   
var pattern_cn = /^[a-zA-Z0-9_]{6,30}([a-zA-Z_0-9])*$/;   
if(pattern_cn.test(str))  
  {      
  return true;
  }    
    else   
  {    
	   return false; 
  }
}
function checkemail(str){ 
var sReg = /[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+$/; 
if ( ! sReg.test(str) ) 
{ 

return false; 
} 

return true; 
}
function regthesame()
{
	if($("#userid").val()!="")
	{
		$.get("inc/reg_inc.php?sj="+Math.random()+"&userid="+$("#userid").val(),function(data)
	 {
		if(data.indexOf("ckuseryes")!=-1)
		{
			alert($("#userid").val()+"，此账号已经存在，请输入另外一个");
			$("#userid").val("");
			$("#userid").focus();
		
		}
	 });
	}
}

function ckcode()
{
	if($("#code").val()!="")
	{
		$.get("inc/reg_inc.php?sj="+Math.random()+"&code="+$("#code").val(),function(data)
	 {
		if(data.indexOf("ckcodeno")!=-1)
		{
			alert("验证码输入不正确,请重新输入");
		     document.getElementById("codeimg").src='/admin/code.php?w=60&amp;h=20&amp;id=' + Math.random();
			$("#code").val("");
			$("#code").focus();
		
		}
	 });
	}
}
function regcheck()
{
	if($("#userid").val()=="")
	{
		alert("账号不能为空");
		$("#userid").focus();
		return false;
	}
	if(!isCnAndEnAndNumber($("#userid").val()))
	{
		alert("账号由6-30个字符组成，只能使用英文字母数字下划线或三者的组合");
		$("#userid").focus();
		return false;
	}
	if($("#password").val()=="")
	{
		alert("密码不能为空");
		$("#password").focus();
		return false;
	}
	if($("#password").val().length<6 || $("#password").val().length>31 )
	{
		alert("密码个数应该在6-30个字符之间");
		$("#password").focus();
		return false;
	}
	if($("#password").val()!=$("#cpassword").val())
	{
		alert("两次密码输入不一样");
		$("#cpassword").focus();
		return false;
	}
	if($("#email").val()=="")
	{
		alert("email不能为空");
		$("#email").focus();
		return false;
	}
		if( !checkemail($("#email").val()))
	{
		alert("email格式不正确");
		$("#email").focus();
		return false;
	}
		if($("#code").val()=="")
	{
		alert("验证码不能为空");
		$("#code").focus();
		return false;
	}
	return true;
}
</script>
</head>

<body>
<table width="1004" border="0" align="center" cellpadding="0" cellspacing="0" background="skins/stlye/images/zcbj_01.jpg">
 <tr>
    <td colspan="3" height="30"></td>
  </tr>
   <tr>
    <td width="291" align="left" valign="bottom"><img src="skins/stlye/images/logobb_03.jpg" width="291" height="37" /></td>
   
    <td width="702" align="left" valign="bottom"  style="border-left:solid 1px #FFF; padding-left:5px;"><img src="skins/stlye/images/yz_05.jpg" width="123" height="37"  /></td>
  </tr>
  <tr>
  <td colspan="2" height="15"></td>
 </tr>
 </table>
 <table width="1004" border="0" align="center" cellpadding="0" cellspacing="0" style="background:url(skins/stlye/images/zcxkjbj_02.jpg) repeat-x;">
  <tr>
    <td align="center" valign="top" style=" padding-top:15px;"><table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" style="font-size:14px; font-weight:bold">万利达书城通行证</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="bottom" style="font-size:14px; padding-left:10px; border-bottom:solid 1px #CCC;">设置您的账号信息</td>
      </tr>
      <tr>
        <td style="padding-left:30px;"><form id="reg1" name="reg1" action="inc/reg_inc.php" method="post" onsubmit="return regcheck()"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="17%" align="right" style="font-size:14px;">&nbsp;</td>
        <td colspan="2" align="left">&nbsp;</td>
        <td width="64%" align="left" style="color: #999;">&nbsp;</td>
      </tr>
      <tr>
        <td align="right" style="font-size:14px;">账号：</td>
        <td colspan="2" align="left"><input name="userid" type="text" id="userid" size="25" maxlength="50" onblur="regthesame()"  /></td>
        <td align="left" style="color: #999;">您的登录账号，账号由6-30个字符组成，只能使用英文字母数字下划线或三者的组合</td>
        </tr>
      <tr>
        <td align="right" style="font-size:14px;">密码：</td>
        <td colspan="2" align="left"><input name="password" type="password" id="password" size="25" maxlength="50" /></td>
        <td align="left" style="color: #999;">密码由6-30个字符组成</td>
      </tr>
      <tr>
        <td align="right" style="font-size:14px;">再输入一遍密码：</td>
        <td colspan="2" align="left"><input name="cpassword" type="password" id="cpassword" size="25" maxlength="50" /></td>
        <td align="left" style="color: #999;">请再输入一遍您上面输入的密码</td>
        </tr>
      <tr>
        <td align="right" style="font-size:14px;">EMAIL：</td>
        <td colspan="2" align="left"><input name="email" type="text" id="email" size="25" maxlength="100" /></td>
        <td align="left" style="color: #999;">您将使用此邮件</td>
      </tr>
      <tr>
        <td align="right" style="font-size:14px;">手机号码：</td>
        <td colspan="2" align="left"><input name="shouji" type="text" id="shouji" size="25" maxlength="100" /></td>
        <td align="left" style="color: #999;">(可选)和您保持联系的首选，请输入您的联系电话</td>
        </tr>
      <tr>
        <td align="right" style="font-size:14px;">效验码：</td>
        <td width="9%" align="left"><input name="code" type="text" id="code" size="12" maxlength="5"  onblur="ckcode()"/> </td>
        <td width="10%" align="left">&nbsp;<img src="/admin/code.php?w=60&amp;h=20" alt="看不清楚？点击刷新验证码" name="codeimg" border="1" align="absmiddle" id="codeimg" style="cursor: hand; border:solid 1px #CCC;" onclick="javascript:this.src='/admin/code.php?w=60&amp;h=20&amp;id=' + Math.random();" /></td>
        <td align="left" style="color: #F00;"> 请输入左侧字符，不区分大小写。看不清楚？换个图片
         </td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="left" style="padding-top:10px; padding-left:150px"><input type="submit" name="regbtn1" id="regbtn1" value="注册"  style="background-image:''; width:90px; height:30px"/>
      <input name="regbtn" type="hidden" id="regbtn" value="0" /></td>
  </tr>
  <tr>
    <td align="left" style="padding-top:10px; padding-left:150px; color:">如果您已经注册了账号，<a href="login.php"><span style="color:#03C; text-decoration:underline">请从这里登录</span></a></td>
  </tr>
        </table></form>
</td>
      </tr>
    </table></td>
  </tr>
</table><br />
<br />

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "foot_inc.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>